<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			var str1 = "hello js!";
			console.log(str1.length);
			console.log(str1.toLowerCase());
			console.log(str1.toUpperCase());
			console.log(str1.charAt(6));
			
			var str2 = "Hello js and java";
			console.log(str2.indexOf("js"));//6
			console.log(str2.indexOf("Js"));//-1
			console.log(str2.lastIndexOf("js"));//6
			
			console.log(str2.split(" "));
			
			var str3 = "aaa bbb ccc ddd";
			var array = str3.split(" ");
			console.log(array);//["aaa", "bbb", "ccc", "ddd"]
			console.log(array[2]);//ccc
			console.log("111,222,333".split(","));// ["111", "222", "333"]
			
			
			if (0) {
				console.log("o");
			}//underfined
			if (!0) {
				console.log("!0")
			}
			if (1) {
				console.log("1");
			}//1
			
			var month = 30;
			if (month<1||month>12) {
				month = Number.NaN;
			}
			
			//toFixed()方法 将小数四舍五入为指定位数的小数
			console.log(month);
			var num4 = 1.37;
			console.log(num4.toFixed(1));
			
			
			var array1 = new Array(7);
			console.log(array1.length);//7
			var array2 = new Array(100,"a",true);//3
			console.log(array2.length);
			
			var array3 = new Array();
			array3.push("abc");
			array3.push(123);
			array3.push("dad");
			console.log(array3);
			console.log(array3.pop());
			console.log(array3.pop());
			console.log(array3);
			
		</script>
	</head>
	<body>
	</body>
</html>
